package com.shiwaixiangcun.customer.module.intelligent

import android.os.Bundle
import android.util.Log
import com.shiwaixiangcun.customer.R
import com.shiwaixiangcun.customer.base.BaseActivity
import kotlinx.android.synthetic.main.activity_scan_carmra_success.*
import kotlinx.android.synthetic.main.top_bar_white.*

/**
 * 扫描智能摄像头
 * 二维码成功
 */
class ScanCameraSuccessActivity : BaseActivity() {


    var bundle: Bundle? = null
    var deviceName: String? = null
    var deviceId: String? = null
    var deviceRc: String? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_scan_carmra_success)

        deviceId = intent.extras.getString("device_id")
        deviceName = intent.extras.getString("device_name")
        deviceRc = intent.extras.getString("device_rc")


        Log.e(BUG_TAG, deviceId)
        initViewAndEvent()
    }

    private fun initViewAndEvent() {
        tv_camera_id.text = "DID:$deviceId"
        bundle = Bundle()
        bundle?.putString("device_id", deviceId)
        bundle?.putString("device_name", deviceName)
        bundle?.putString("device_rc", deviceRc)
        back_left.setOnClickListener { finish() }
        btn_add_device.setOnClickListener {

            readyGoThenKill(BindCameraActivity::class.java, bundle)
        }
    }

}
